<?php
/**
 * 
 * A template file used for every page on the site. 
 * All rendered content on the website goes through this file and is displayed and organized by this template.
 * 
 * Variables in template file:
 * - $head_title: the title of the page
 * - $head: various <meta> tags, etc.
 * - $styles: any stylesheet information in terms of <link> tags
 * - $scripts: any javascripts to include in <script> tags
 * - $logo: the website logo, if specified
 * - $menu: the rendered navigation menu
 * - $breadcrumb: the breadcrumb trail for the page, if specified
 * - $title: the main title of the page surrounded by <h1> tags
 * - $tabs: any tabs that might be on the page (ie. view/add/edit tabs)
 * - $messages: any system messages for the page
 * - $content: the main content of the page
 * - $footer: the content of the footer of the page
 */ 
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
	<head>
		<title><?php print($head_title); ?></title>
		<?php print($head); ?>
		<?php print($styles); ?>
		<?php print($scripts); ?>
	</head>
	<body>
		<div id="page">
			<div id="header">
				<?php if (!empty($site_logo)): ?>
					<div id="logo">
						<a href="<?php print(base_path()); ?>"><?php print($site_logo); ?></a>
					</div>
				<?php endif; ?>
				<?php if (!empty($menu)): ?>
					<div class="ui-navigation-menu">
						<?php print($menu); ?>
					</div>
				<?php endif; ?>
			</div>
			<div id="container">
				<div id="main">
					<?php if (!empty($breadcrumb)): ?>
						<?php print($breadcrumb); ?>
					<?php endif; ?>
					<?php if (!empty($title)): ?>
						<?php print(render_heading($title, 1, array('id' => 'title'))); ?>
					<?php endif; ?>
					<?php if (!empty($messages)): ?>
						<div class="messages">
							<?php print($messages); ?>
						</div>
					<?php endif; ?>
					<div id="content">
						<?php print($content); ?>
					</div>
				</div>
			</div>
			<div id="footer-wrapper">
				<div id="footer">
					<?php if (!empty($footer)): ?>
						<?php print($footer); ?>
					<?php endif; ?>
				</div>
			</div>
		</div>
	</body>
</html>
